<#import "../common/constant.ftl" as constant>
<#import "tag.ftl" as tag>
<#import "componentUtils.ftl" as componentUtils>
<#import "pager.ftl" as pager>
<#import "qqSite.ftl" as qqSite>

<#-- component BEGIN -->
<#--
    metro={
        "label":"",
        "img":"",
        "imgClass"
    }
-->
<#macro metroItemRender metro>
    <span class="J_metro_text">${metro.label}</span>
    <a href="${(metro.url)!"#"}" title="点击查看【${metro.label}】案例" target="_blank">
        <@componentUtils.userImgRender fileName=metro.img alt=metro.label attr='class="J_metro_img dn ${(metro.imgClass)!""}"'/>
    </a>
</#macro>

<#--
    items=[
        [
            {"row":"1", "colum":"1", "class":"", "metro":metro},
            {"row":"1", "colum":"2", "class":"", "metro":metro}
        ],
        [{"row":"1", "colum":"1", "class":"", "metro":metro}]
    ]
-->
<#macro metroRender items=[] id="" class="">
<div id="${id}" class="metro ${class} J_metro">
    <table class="content">
        <#list items as rowItem>
            <tr>
                <#list rowItem as cellItemInte>
                    <#local cellItem={"row":"1","colum":"1"}+cellItemInte/>
                    <#local rowspan=tag.tagAttrEvaluate(cellItem.row!="1","rowspan",cellItem.row)/>
                    <#local colspan=tag.tagAttrEvaluate(cellItem.colum!="1","colspan",cellItem.colum)/>
                    <td class="J_metro_item item ${cellItem.class}" ${rowspan} ${colspan}>
                        <@metroItemRender cellItem.metro/>
                    </td>
                </#list>
            </tr>
        </#list>
    </table>
</div>
</#macro>

<#--
    items=[
        {"url":"","src":""}
    ]
-->
<#macro sliderRender items=[] id="" class="">
<div id="${id}" class="box_skitter ${class}">
    <ul>
        <#list items as item>
            <li><a href="${(item.url)!"javascript:void(0);"}">
                <@componentUtils.userImgRender fileName=item.src/>
            </a></li>
        </#list>
    </ul>
</div>
</#macro>
<#-- component END -->

<#--
    items=[
        [{"src":""}],
        […]
    ]
-->
<#macro scrollsRender items=[] id="" class="">
<div ${tag.tagAttr("id",id)} class="scroll_box ${class} J_scroll">
    <span class="prev browse left J_steering"><i class="bg icon icon_l"></i></span>
    <div class="scrollable J_scrollable">
        <div class="items">
            <#list items as block>
                <div class="l">
                    <#list block as item>
                        <@componentUtils.userImgRender fileName=item.src attr='class="item J_scrollItem"'/>
                    </#list>
                </div>
            </#list>
        </div>
    </div>
    <span class="next browse right J_steering"><i class="bg icon icon_r"></i></span>
</div>
</#macro>

<#--
    items=[
        {"label":"","url":""}
    ]
-->
<#macro menuRender items=[] id="" class="">
<div  ${tag.tagAttr("id",id)} class="main_l menu ${class}">
    <#list items as itemInte>
        <#local item={"url":"javascript:void(0);"}+itemInte/>
        <a href="${item.url}" class="item">${item.label}</a>
    </#list>
</div>
</#macro>